# mongodb的序列化中导入DocumentSerializer
from rest_framework_mongoengine.serializers import DocumentSerializer
# 把要序列化的模型内容导入
from .models import *

# 序列化的作用为序列化成json格式的字符串
# 歌手的序列化器（继承的是DocumentSerializer）
class SingerSerializers(DocumentSerializer):
    # 声明序列化的歌手模型的所需要具体信息
    class Meta:
        model = SingerInfo
        fields = ('_id', 'singer_id', 'singer_pic', 'singer_kind', 'singer_name', 'singer_song_list')


# 一个歌手的序列化
class OneSingerSerializers(DocumentSerializer):
    class Meta:
        model = SingerInfo
        fields = ('singer_id', 'singer_name', 'singer_pic', 'singer_song_list')


# 歌手种类
class SingerKindSerializers(DocumentSerializer):
    class Meta:
        model = SingerInfo
        fields = ('singer_id', 'singer_name', 'singer_pic', 'singer_kind', )


